package me.zhengjie.utils.enums;

/**
 * @author 黄星星
 * @date 2020-06-26
 */
public enum CarTypeEnums {
    INNER_CAR(1L, "内部车辆", "inner_car"),
    EMPLOYEE_CAR(2L, "员工车辆", "employee_car"),
    TEMP_CAR(3L, "临时车辆", "temp_car"),
    ;
    private Long id;
    private String name;
    private String code;

    CarTypeEnums(Long id, String name, String code) {
        this.id = id;
        this.name = name;
        this.code = code;
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public static CarTypeEnums find(Long id) {
        for (CarTypeEnums carTypeEnum : CarTypeEnums.values()) {
            if (id.equals(carTypeEnum.getId())) {
                return carTypeEnum;
            }
        }
        return null;
    }
}
